<html>
<head>
    <meta charset="utf-8">
    <title>关键词订阅</title>
    <link rel="stylesheet" type="text/css" href="../../assest/plugins/bootstrap/css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="../../assest/css/win.css"/>
    <link rel="stylesheet" type="text/css" href="../../assest/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="./keywords.css">
</head>
<body>
<div id="keywords" class="page-container">
    <div class="area-wrap">
        <div class="area-header">
            <em>关键词订阅</em>

            <div class="kw-actions">
                <div class="keys-search">
                    <input id="keys-name" maxlength="7" type="text" v-on="keyup:addKeys | key 13" placeholder="输入关键词"/>
                    <span class="add-btn btn-color-green-hover js-add-btn" v-on="click:addKeys()">添加</span>
                </div>
                <span class="btn btn-default js-update-btn" v-on="click:updateKeys((keySelect[0]),1)">更新文章</span>
                <span class="btn btn-default btn-manage" v-on="click:manageKeys()" v-text="isInEditKeys?'完成':'管理关键词'"></span>
            </div>
        </div>
        <div class="keywords-num">
            <span style="margin-right:5px;">已为您订阅 <span class="green">{{keys.length}}</span> 个关键词 : </span>
            <ul class="js-keys-ctn keys-ctn">
                <li v-repeat="key:keys" v-class="active-btn:key.id===nowActiveKey" v-on="click:showArticle(key)" data-id="{{key.id}}" class="btn btn-default keys-name">
                    <div v-on="click:deleteKeys(key,$event)" class="js-close"></div>
                    {{key.keyword}}
                </li>
            </ul>

        </div>
        <div id="tableHeaderFixed" class="table-placeholder-wrap">
            <table class="table-account table-account-1">
                <thead>
                <tr class="col-align-center table-public-header">
                    <th width="150">公众号</th>
                    <th >文章标题</th>
                    <th width="100">文章类型</th>
                    <th width="100">发布时间</th>
                    <th width="100" v-on="click:sortByRead( sortKey == 'read_num-desc' ? '': 'read_num-desc')">
                        阅读数
                        <i class="fa fa-sort-desc table-sort {{sortKey == 'read_num-desc' ? 'active': ''}}" aria-hidden="true"></i>
                    </th>
                    <th width="100" v-on="click:sortByRead(sortKey == 'like_num-desc' ? '': 'like_num-desc')">点赞数
                        <i class="fa fa-sort-desc table-sort {{sortKey == 'like_num-desc' ? 'active': ''}}" aria-hidden="true"></i>
                    </th>
                    <th width="100">操作</th>
                </tr>
                </thead>
            </table>
        </div>

        <table id="table" class="table-account table-account-1" v-cloak>
            <thead>
            <tr class="col-align-center table-public-header">
                <th width="150">公众号</th>
                <th >文章标题</th>
                <th width="100">文章类型</th>
                <th width="100">发布时间</th>
                <th width="100" v-on="click:sortByRead( sortKey == 'read_num-desc' ? '': 'read_num-desc')">
                    阅读数
                    <i class="fa fa-sort-desc table-sort {{sortKey == 'read_num-desc' ? 'active': ''}}" aria-hidden="true"></i>
                </th>
                <th width="100" v-on="click:sortByRead(sortKey == 'like_num-desc' ? '': 'like_num-desc')">点赞数
                    <i class="fa fa-sort-desc table-sort {{sortKey == 'like_num-desc' ? 'active': ''}}" aria-hidden="true"></i>
                </th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody v-if="data.length>0">
            <tr v-repeat="k:data">
                <td>{{k.account?k.account:'--'}}</td>
                <td><a v-on="click:goToLink(k.url)" href="javascript:;">{{k.title?k.title:'--'}}</a></td>
                <td><span class="btn default {{k.content_type==0?'type1':'type2'}}">{{k.content_type | msgType}}</span></td>
                <td>{{k.push_time | msgTime}}</td>
                <td>{{k.read!=0?k.read:'--'}}</td>
                <td>{{k.like!=0?k.like:'--'}}</td>
                <td>

                    <a class="trigger-btn" href="javascript:;" v-on="click:clickAddMaterial(k,$event)">
                        <span><i class="fa fa-plus-square"></i></span>
                    </a>
                    |
                    <a class="trigger-btn" href="javascript:;" v-on="click:clickAddMaterialElse(k)">
                        <span><i class="fa fa-external-link-square"></i></span>
                    </a>

                </td>
            </tr>
            </tbody>
        </table>
        <div class="data-empty-tips" v-if="data.length==0 && keys.length>0">
            <img src="./img/rank-smile.png">
            <p>文章更新中，请稍后再来</p>
        </div>
        <div class="data-empty-tips" v-if="keys.length==0">
            <p>暂无订阅关键词，请先去添加关键词</p>
        </div>
        <div class="load-more">
            <span class="btn none-visibility js-loadMore" v-show="article_list_no" v-on="click:loadMore()">加载更多</span>
        </div>
    </div>
</div>

<script type="text/javascript" src="../../assest/plugins/jquery.min.js"></script>
<script type="text/javascript" src="../../assest/plugins/underscore-min.js"></script>
<script type="text/javascript" src="../../assest/plugins/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../assest/plugins/vue.min.js"></script>
<script type="text/javascript" src="../../assest/plugins/win.js"></script>
<script type="text/javascript" src="./keywords.js"></script>
<script>
    window.top.loading.hide()
    $(function () {
        vm.getKeys();

        var tableHeaderFixed = $('#tableHeaderFixed');
        $(window).scroll(function () {
            var top = $(window).scrollTop();
            if (top > 140) {
                tableHeaderFixed.show();
            } else {
                tableHeaderFixed.hide();
            }
        });
        var SogouUtilUrl='http://www.wxb.com/js/client.keyword.min.js';
        try{
            if(window.top.GUI.App.manifest.version=='9.8.7'){//开发模式
                SogouUtilUrl='../../assest/js/utils/client.keyword.min.js';
            }
        }catch (e){}

        $.getScript(SogouUtilUrl, function(){
        }).error(function () {
            console.log(arguments);
        });
    });
</script>
</body>
</html>
